
#ifndef _MEMBER_BVBOXLAYOUT_H_
#define _MEMBER_BVBOXLAYOUT_H_

#include <BSpring>
#include <BSpacer>
#include <BWidget>
#include <BVBoxLayout>
#include "member_BLayout.h"

#define vboxlayout_member(layout)		((member_BVBoxLayout*)((BVBoxLayout*)layout)->_ptr)

namespace BWE
{
	class BWidget;

	class member_BVBoxLayout
	{
	public:
		member_BVBoxLayout(BVBoxLayout* layout);
		~member_BVBoxLayout();

		BRect handleRect(int index);
		void checkHandle(int& handle);
		bool dragHandle(const BPoint& pos);

		void distributeHeight();
		void applyRects();

	public:
		BLayout*			boss;
		int					spacing;
		BSize				handleSize;

		int					totalBaseHeight;
		float				totalStretch;
		int					handleIndex;
		BRange				upLimit;
		BRange				downLimit;
		bool				pressed;
		BPoint				pressCenter;
		BArray<CacheSize>	dragCaches;
		BArray<LayoutItem>	items;
	};
}

#endif
